package com.gloaba.common.log.service;

import com.gloaba.common.log.constant.LogMqConstants;
import com.gloaba.common.log.domain.SysOperLogBO;
import com.gloaba.common.mq.utils.MqUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * 异步调用日志服务
 *
 * @author Oceania
 */
@Service
@Slf4j
@RequiredArgsConstructor
public class AsyncLogService
{
    private final MqUtils mqUtils;
    /**
     * 保存系统日志记录到消息队列
     */
    @Async
    public void saveSysLog(SysOperLogBO sysOperLog)
    {
        mqUtils.sendQueue(LogMqConstants.LOG_OPERATE_QUEUE,sysOperLog);

    }
}
